package cn.fresh.xuanyuan.module.trade.api.cart;

import cn.fresh.xuanyuan.framework.common.pojo.CommonResult;
import cn.fresh.xuanyuan.module.trade.api.cart.dto.CartDto;
import cn.fresh.xuanyuan.module.trade.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 购物车")
public interface CartApi {

    String PREFIX = ApiConstants.PREFIX + "/cart";

    @GetMapping(PREFIX + "/list")
    @Operation(summary = "获得订单列表")
    @Parameter(name = "ids", description = "订单编号数组", required = true)
    CommonResult<List<CartDto>> getCurrentUserCartList(@RequestParam(name = "userId") Long userId);
}
